<?php
	include_once "../DB_Oracle.php";
	include_once "../JSON.php";
	$DBsql = new DB_Oracle ();
	$act = $_POST ['act'];
	if ($act=='location'){
		$southWestLngX=$_POST['southWestLngX'];
		$southWestLatY=$_POST['southWestLatY'];
		$northEastLngX=$_POST['northEastLngX'];
		$northEastLatY=$_POST['northEastLatY'];
		$sql="select * from (select lm.personnel_sn,
               lm.longitude,
               lm.latitude,
               lm.mapmark_index,
               lm.mapmark_info,
               to_char(lm.mapmark_time,'yyyy-mm-dd hh24:mi:ss') mapmark_time
					  from loc_mapmark lm
					 where lm.longitude > '".$southWestLngX."'
					   and lm.longitude < '".$northEastLngX."'
					   and lm.latitude > '".$southWestLatY."'
					   and lm.latitude < '".$northEastLatY."'
					   order by lm.mapmark_time desc)m
					   where rownum<200";
		$rows=$DBsql->fetch_all_array($sql);
		if(count($rows)==0){
			echo '{
						"info":"没有该类型的数据！",
						"status":"y"
					}';
		}else{
			echo JSON($rows);
		}
	}
?>